import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Reg from '../views/Reg.vue'
import Home from '../views/Home.vue'
import UserInfo from '../components/UserInfo.vue'

Vue.use(VueRouter)

const routes = [
  { path: '/login', component: Login },
  { path: '/reg', component: Reg },
  {
    path: '/',
    component: Home,
    children: [
      // 通过children属性来说明嵌套的子级路由对应规则
      { path: 'user-info', component: UserInfo }
      // { path: 'two', component: Two }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
